//
//  LYModuleManager.h
//  LYModuleService
//
//  Created by cqck on 2021/11/24.
//

#import <Foundation/Foundation.h>

#define LYServiceSectName "LYModuleServices"
#define LYSECDATA(sectname) __attribute((used, section("__DATA,"#sectname" ")))

#define EXPORT_SERVICE(servicename,impl) \
char * k##servicename##_service LYSECDATA(LYModuleServices) = "{ \""#servicename"\" : \""#impl"\"}";

@interface LYModuleManager : NSObject

+ (instancetype)sharedLYModuleManager;

- (id)fetchModuleService:(Protocol *)service;

- (BOOL)registerService:(Protocol *)service implClass:(Class)implClass;

@end
